package de.uni.muenster.idw2.data;

import android.os.Parcel;
import android.os.Parcelable;

public class Position implements Parcelable{

	private double x;
	private double y;
	private int floor;
	private int height;
	private int accuracy;
	private String source;
	
	public Position(Parcel source){
		x = source.readDouble();
		y = source.readDouble();
		floor = source.readInt();
		height = source.readInt();
		accuracy = source.readInt();
		this.source = source.readString();
	}
	
	public Position(double x, double y, int floor) {
		super();
		this.x = x;
		this.y = y;
		this.floor = floor;
	}
	public double getX() {
		return x;
	}
	public void setX(double x) {
		this.x = x;
	}
	public double getY() {
		return y;
	}
	public void setY(double y) {
		this.y = y;
	}
	public int getFloorNumber() {
		return floor;
	}
	public void setFloorNumber(int floor) {
		this.floor = floor;
	}
	public void setHeight(int height) {
		this.height = height;
	}
	public int getHeight() {
		return height;
	}
	public void setAccuracy(int accuracy) {
		this.accuracy = accuracy;
	}
	public int getAccuracy() {
		return accuracy;
	}
	public void setSource(String source) {
		this.source = source;
	}
	public String getSource() {
		return source;
	}
	
	
	@Override
	public int describeContents() {
		return 0;
	}
	/**
	 * private double x;
	private double y;
	private int floor;
	private int height;
	private int accuracy;
	private String source;
	 */
	
	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeDouble(x);
		dest.writeDouble(y);
		dest.writeInt(floor);
		dest.writeInt(height);
		dest.writeInt(accuracy);
		dest.writeString(source);
		
	}
	
	public static final Parcelable.Creator CREATOR = new Creator() {

		@Override
		public Position createFromParcel(Parcel source) {
			return new Position(source);
		}

		@Override
		public Position[] newArray(int size) {
			return new Position[size];
		}
	};
	
	
}
